Fix save/restore and migrate on x86_64.
authorsmh22@firebug.cl.cam.ac.uk <smh22@firebug.cl.cam.ac.uk>
Sat, 26 Nov 2005 11:13:39 +0000 (12:13 +0100)
committersmh22@firebug.cl.cam.ac.uk <smh22@firebug.cl.cam.ac.uk>
Sat, 26 Nov 2005 11:13:39 +0000 (12:13 +0100)
Signed-off-by: Steven Hand <steven@xensource.com>
tools/libxc/xc_linux_save.c
tools/python/xen/xend/XendCheckpoint.py

index 467598fec46ee3dcbe99a7ecbd41387b1bff101c..16eae762fc46d01113ab82d949ef60f2cf7a9a66 100644 (file)
@@ -457,6 +457,15 @@ void canonicalize_pagetable(unsigned long type, unsigned long pfn,
             xen_start = (hvirt_start >> L2_PAGETABLE_SHIFT_PAE) & 0x1ff; 
     }
 
+       if (pt_levels == 4 && type == L4TAB) { 
+               /* 
+        ** XXX SMH: should compute these from hvirt_start (which we have) 
+               ** and hvirt_end (which we don't) 
+        */
+               xen_start = 256; 
+               xen_end   = 272; 
+       }
+
     /* Now iterate through the page table, canonicalizing each PTE */
     for (i = 0; i < pte_last; i++ ) {
 
@@ -721,12 +730,6 @@ int xc_linux_save(int xc_handle, int io_fd, uint32_t dom, uint32_t max_iters,
     }
 
     /* Domain is still running at this point */
-
-    if (live && (pt_levels == 4)) {
-        ERR("Live migration not supported for 64-bit guests");
-        live = 0;
-    }
-
     if (live) {
 
         if (xc_shadow_control(xc_handle, dom, 
@@ -811,7 +814,7 @@ int xc_linux_save(int xc_handle, int io_fd, uint32_t dom, uint32_t max_iters,
         for (i = 0; i < max_pfn; i++) {
 
             mfn = live_p2m[i];
-            if((mfn != 0xffffffffUL) && (mfn_to_pfn(mfn) != i)) { 
+            if((mfn != INVALID_P2M_ENTRY) && (mfn_to_pfn(mfn) != i)) { 
                 DPRINTF("i=0x%x mfn=%lx live_m2p=%lx\n", i, 
                         mfn, mfn_to_pfn(mfn));
                 err++;
index 04fda474b49ccfbfef452ec25a33fca927f52a67..a50a7b2cff77fd9ce46564e0b3105f2335671af7 100644 (file)
@@ -128,7 +128,7 @@ def restore(xd, fd):
     try:
         l = read_exact(fd, sizeof_unsigned_long,
                        "not a valid guest state file: pfn count read")
-        nr_pfns = unpack("=L", l)[0]   # XXX endianess
+        nr_pfns = unpack("L", l)[0]    # native sizeof long
         if nr_pfns > 16*1024*1024:     # XXX 
             raise XendError(
                 "not a valid guest state file: pfn count out of range")